﻿using System;

public class PlayerData
{
	public Action<int> OnLifeNumChange;
	private int _lifeNum = 3;
	/// <summary>
	/// 生命数
	/// </summary>
	public int LifeNum {
		get {
			return _lifeNum;
		}
		set {
			if (!_lifeNum.Equals(value)) {
				_lifeNum = value;
				if (OnLifeNumChange != null) {
					OnLifeNumChange(_lifeNum);
				}
			}
		}
	}

	public Action<int> OnMoveSpeedPlusChange;
	private int _moveSpeedPlus = 0;
	/// <summary>
	/// 移动速度加成
	/// </summary>
	public int MoveSpeedPlus
	{
		get
		{
			return _moveSpeedPlus;
		}
		set
		{
			if (!_moveSpeedPlus.Equals(value))
			{
				_moveSpeedPlus = value;
				if (OnMoveSpeedPlusChange != null)
				{
					OnMoveSpeedPlusChange(_moveSpeedPlus);
				}
			}
		}
	}

	public Action<int> OnFireDisPlusChange;
	private int _fireDisPlus = 0;
	/// <summary>
	/// 爆炸范围加成
	/// </summary>
	public int FireDisPlus
	{
		get { return _fireDisPlus; }
		set
		{
			if (!_fireDisPlus.Equals(value))
			{
				_fireDisPlus = value;
				if (OnFireDisPlusChange != null)
				{
					OnFireDisPlusChange(_fireDisPlus);
				}
			}
		}
	}

	public Action<int> OnCarryBombNumPlusChange;
	private int _carryBombNumPlus;
	/// <summary>
	/// 携带数量
	/// </summary>
	public int CarryBombNumPlus
	{
		get { return _carryBombNumPlus; }
		set
		{
			if (!_carryBombNumPlus.Equals(value))
			{
				_carryBombNumPlus = value;
				if (OnCarryBombNumPlusChange != null)
				{
					OnCarryBombNumPlusChange(_carryBombNumPlus);
				}
			}
		}
	}

	public void Reset()
	{
		MoveSpeedPlus = 0;
		FireDisPlus = 0;
		CarryBombNumPlus = 0;
		LifeNum = 3;
	}
}
